﻿<navigation:Page 
    x:Class="ibba.src.norisk.page.PageParesIndexadores" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
    xmlns:slc="clr-namespace:ibba.src.slcomponentes;assembly=ibba.src.slcomponentes"
    d:DesignWidth="640" d:DesignHeight="480"
    Title="Sistema NORISK">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <ContentControl x:Name="panelMenuBar" Style="{StaticResource ContentSearchBarStyle}" Grid.Row="0" />

        <StackPanel Grid.Row="1" VerticalAlignment="Top" Margin="10,-5,0,10">
            <TextBlock Foreground="#FFC4991C" FontSize="14" FontFamily="Verdana" Margin="0,5,0,0" Text="Parametrização de Pares de Indexadores" />
        </StackPanel>

        <StackPanel Grid.Row="1" 
                    VerticalAlignment="Top" 
                    HorizontalAlignment="Left"
                    Margin="20,35,0,0">

            <TextBlock Foreground="#B8860B" 
                       FontSize="12" 
                       FontFamily="Verdana" 
                       Margin="0,5,0,0" 
                       Text="Parametro:" />

            <ComboBox x:Name="cboParametro" 
                      Margin="0,2,0,2" 
                      Width="140" 
                      Height="24" 
                      VerticalAlignment="Top" 
                      HorizontalAlignment="Left"
                      SelectionChanged="cboParametro_SelectionChanged"/>

        </StackPanel>


        <slc:CustomContentPanel Name="panelInserir" HeaderPadding="10,5" Margin="10,100,0,0" Grid.Row="1"
                                BorderBrush="#FFD1D1D1" 
                                Header="Adicionar Par Indexador" 
                                HorizontalAlignment="Left" VerticalAlignment="Top"
                                HorizontalContentAlignment="Center" VerticalContentAlignment="Center" >


            <Grid Margin="0,0,0,0" Width="550">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="150"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="70"/>
                </Grid.RowDefinitions>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,10,0,0" Grid.Column="0">
                    <TextBlock  Text="Indexador Ativo" FontSize="12" Margin="30,0,0,0" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,25,0,0" Grid.Column="0">
                    <sdk:AutoCompleteBox x:Name="txtIndexadorAtivo" 
                                         IsTextCompletionEnabled="True" 
                                         IsTabStop="True" 
                                         FilterMode="Contains"
                                         ItemsSource="{Binding}"
                                         Width="150" 
                                         Height="24"
                                         Margin="30,0,0,0">
                    </sdk:AutoCompleteBox>
                </StackPanel>


                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,10,0,0" Grid.Column="1">
                    <TextBlock  Text="Indexador Passivo" FontSize="12" Margin="30,0,0,0" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,25,0,0" Grid.Column="1">
                    <sdk:AutoCompleteBox x:Name="txtIndexadorPassivo" 
                                         IsTextCompletionEnabled="True" 
                                         IsTabStop="True" 
                                         FilterMode="Contains"
                                         ItemsSource="{Binding}"
                                         Width="150" 
                                         Height="24"
                                         Margin="30,0,0,0">
                    </sdk:AutoCompleteBox> 
                </StackPanel>

                <Button x:Name="btnAddPar" Margin="26,22,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="90" Height="26" Grid.Column="2" Click="btnAddPar_Click">

                   <StackPanel Orientation="Vertical" Margin="-55,-3,-52,0" Width="90" Height="26">
                      <Image Source="../image/add.png" Width="18" HorizontalAlignment="Left" Margin="5,5,0,7" />
                         
                      <TextBlock Text="Adicionar" Margin="28,-25,8,0" FontSize="12"/>
                   </StackPanel>
                </Button>


            </Grid>

        </slc:CustomContentPanel>

        <data:DataGrid x:Name ="grdParesIndexadores" Grid.Row="2"
        	            Margin="12,10,0,30" RenderTransformOrigin="0.5,0.5" 
        	            Visibility="Visible"
        	            MinHeight="120" AlternatingRowBackground="#FFFCFCFC" 
        	            RowBackground="#FFFCFCFC" 
                        AutoGenerateColumns="False" 
        	            BorderBrush="#FFF8F8F8" 
        	            HorizontalScrollBarVisibility="Hidden"
        	            ItemsSource="{Binding}" HorizontalAlignment="Left">
            <data:DataGrid.Columns>

                <data:DataGridTextColumn  Header="Indexador Ativo" Binding="{Binding CodIndexadorAtivo}" Width="250" IsReadOnly="True"/>

                <data:DataGridTextColumn Header="Indexador Passivo" Binding="{Binding CodIndexadorPassivo}" Width="250" IsReadOnly="True"/>

                <data:DataGridTemplateColumn Header="Excluir" Width="70" IsReadOnly="True">
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>

                            <Button x:Name="btnDelPar" Margin="0,0,0,0" HorizontalAlignment="Center"  VerticalAlignment="Center"  Width="20" Height="20" Background="Transparent" Click="btnDelPar_Click" >
                                <StackPanel Orientation="Vertical" Margin="0,0,0,0" Width="20" Height="20">
                                    <Image Source="../image/delete.png" Width="18" HorizontalAlignment="Center" Margin="0,0,0,0" />
                                </StackPanel>
                            </Button>

                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>

            </data:DataGrid.Columns>
        </data:DataGrid>

    </Grid>
    
</navigation:Page>
